package net.alcuria.ball;

import net.alcuria.framework.Game;
import net.alcuria.framework.Graphics;
import net.alcuria.framework.Screen;
import net.alcuria.framework.Graphics.PixmapFormat;

public class LoadingScreen extends Screen {

	public LoadingScreen(Game game){
		super(game);
	}

	public void update(float deltaTime) {
		Graphics g = game.getGraphics();
	
		// we have to load all the assets
		Assets.background = g.newPixmap("background/background.png", PixmapFormat.RGB565);
		Assets.sky = g.newPixmap("background/sky.png", PixmapFormat.RGB565);
		Assets.parallax = g.newPixmap("background/parallax.png", PixmapFormat.ARGB4444);
		Assets.foreground = g.newPixmap("background/foreground.png", PixmapFormat.ARGB4444);
		
		Assets.tileset = g.newPixmap("tileset/tileset.png", PixmapFormat.ARGB4444);

		Assets.button = g.newPixmap("sprite/button.png", PixmapFormat.ARGB4444);
		Assets.sound = g.newPixmap("sprite/sound.png", PixmapFormat.ARGB4444);
		Assets.character = g.newPixmap("sprite/carrots.png", PixmapFormat.ARGB4444);
		Assets.ball = g.newPixmap("sprite/ball.png", PixmapFormat.ARGB4444);
		
		Assets.sparkle = g.newPixmap("sprite/sparkle.png", PixmapFormat.ARGB4444);
		Assets.splash = g.newPixmap("sprite/splash.png", PixmapFormat.ARGB4444);
		Assets.crumble = g.newPixmap("sprite/crumble.png", PixmapFormat.ARGB4444);
		Assets.dust = g.newPixmap("sprite/dust.png", PixmapFormat.ARGB4444);
		Assets.powerupSprite = g.newPixmap("sprite/powerup.png", PixmapFormat.ARGB4444);
		Assets.iceBreak = g.newPixmap("sprite/icebreak.png", PixmapFormat.ARGB4444);

		Assets.click = game.getAudio().newSound("sound/click.wav");
		Assets.press = game.getAudio().newSound("sound/press.wav");
		Assets.jump = game.getAudio().newSound("sound/jump.wav");
		Assets.chomp = game.getAudio().newSound("sound/chomp.wav");
		Assets.water = game.getAudio().newSound("sound/water.wav");
		Assets.breaks = game.getAudio().newSound("sound/break.wav");
		Assets.land = game.getAudio().newSound("sound/land.wav");
		Assets.powerup = game.getAudio().newSound("sound/powerup.wav");
		Assets.ice = game.getAudio().newSound("sound/ice.wav");
		Assets.hiss = game.getAudio().newSound("sound/hiss.wav");
		Assets.spring = game.getAudio().newSound("sound/spring.wav");
		
		Assets.elysium = game.getAudio().newMusic("music/elysium.ogg");
		Assets.world1 = game.getAudio().newMusic("music/world1.ogg");

		// load our settings
		Settings.load(game.getFileIO());
		
		// change screens to the main menu after loading
		game.setScreen(new MainMenuScreen(game));
	}

	@Override
	public void present(float deltaTime) {
	}
	@Override
	public void pause() {
	}
	@Override
	public void resume() {
	}
	@Override
	public void dispose() {
	}


}
